From: Carlos Garnacho Date: Fri, 26 Jan 2024 11:02:30 +0000 (+0100) Subject: keyboard: Simplify key width handling X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~1^2~90 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a93858b862502759f55334f98f0d856fdb9d0c57;p=gnome-shell.git keyboard: Simplify key width handling We do not need to store the key width in the Key object itself when constructing the layout, and can attach it to the grid from the model data right away. Part-of: --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 38f1b8ee3..fb83db7e9 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -437,7 +437,6 @@ const Key = GObject.registerClass({ button.set_label(commitString); } - button.keyWidth = 1; button.connect('button-press-event', () => { this._press(button, commitString); button.add_style_pseudo_class('active'); @@ -505,10 +504,6 @@ const Key = GObject.registerClass({ return this._boxPointer; } - setWidth(width) { - this.keyButton.keyWidth = width; - } - setLatched(latched) { if (latched) this.keyButton.add_style_pseudo_class('latched'); @@ -1528,9 +1523,6 @@ export const Keyboard = GObject.registerClass({ keyval: key.keyval, }, strings); - if (key.width !== null) - button.setWidth(key.width); - if (key.action !== 'modifier') { button.connect('commit', (_actor, keyval, str) => { this._commitAction(keyval, str).then(() => { @@ -1590,7 +1582,7 @@ export const Keyboard = GObject.registerClass({ if (key.action || key.keyval) button.keyButton.add_style_class_name('default-key'); - layout.appendKey(button, button.keyButton.keyWidth); + layout.appendKey(button, key.width); } }